<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">班级说说</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="comment active" data-type="1"><a >全部说说<span class="sr-only">(current)</span></a></li>
                <li class="comment" data-type="2"><a>我的说说</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">成员列表 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <% for(var i=0; i<friends.length; i++){%>
                        <% if(friends[i].username===username){continue;}%>
                        <li><a href="/showUserComment/<%= friends[i].username%>"><%= friends[i].username%></a></li>
                        <%}%>
                    </ul>
                </li>
            </ul>
            <%= active%>
            <%= login%>
            <ul class="nav navbar-nav navbar-right">
                <% if(!login){%>
                    <% if(active == 'index'){%>
                        <li><a href="/register">注册</a></li>
                        <li><a href="/login">登陆</a></li>
                    <% } else if(active!='register'){%>
                        <li><a href="/register">注册</a></li>
                    <% } else if(active!='login'){%>
                        <li><a href="/login">登陆</a></li>
                    <% }%>
                <% } else {%>
                    <li role="presentation" class="dropdown">
                        <a style="font-size:12px;" class="dropdown-toggle" data-toggle="dropdown" role="button"
                           aria-haspopup="true" aria-expanded="false">欢迎&nbsp;<%= username%>&nbsp;<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li>
                                <div class="user-avatar">
                                    <img src="/<%= userAvatar%>" alt="" width="60" height="60">
                                    <p><%= username%></p>
                                </div>
                            </li>
                            <li role="separator" class="divider"></li>
                            <li><a href="/editUserInfo">修改个人头像</a></li>
                            <li><a href="#">Another action</a></li>
                            <li><a href="#">Something else here</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="/doExit" style="font-size:12px;">注销</a></li>
                        </ul>
                    </li>
                <% }%>
            </ul>
        </div>
    </div>
</nav>